//引入更改属性
import { useState } from "react"
//引入子组件
import Liebiao from "./liebiaozujian"
import Shuzujian from "./shuruzujian"
//创建页面
const Todolist =()=>{
    //属性值
    const [list,setlist]= useState({
        list:[
            {
                data:"2023/3/3",
                title:"前端工程师",
                num:'1',
            }
        ]
    })
    //更改添加属性
    let todolist=(msg)=>{
        console.log(msg)
        let arrList = list.list
        arrList.push(msg)
        //const方法 
        setlist({
            list:arrList
        })
    }
    //页面
    return(
        <>
            <div className="todolist">
                <div className="todo_list">
                    {/* 子组件引入 */}
                        <Shuzujian todolist={todolist}/>
                        <Liebiao list={list}/>
                </div>
            </div>
        </>
    )
}

export default Todolist